package com.tian.controller.management;

import com.tian.common.CommonResult;
import com.tian.dto.*;
import com.tian.service.ChargeStationGunService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * {@code @description:} TODO
 *
 * @author tianwc 公众号：Java后端技术全栈
 * 在线刷题 1200+java面试题和1000+篇技术文章：<a href="https://woaijava.cc/">博客地址</a>
 * {@code @date:} 2024-08-25 14:40
 * {@code @version:} 1.0
 */
@RestController
@RequestMapping("/management/station/gun")
public class ChargeStationGunController {
    @Resource
    private ChargeStationGunService chargeStationGunService;

    @PostMapping("/add")
    public CommonResult<Boolean> add(@RequestBody ChargeStationGunReqDto chargeStationGunReqDto) {
        return chargeStationGunService.add(chargeStationGunReqDto);
    }

    @PostMapping("/update")
    public CommonResult<Boolean> update(@RequestBody ChargeStationGunReqDto chargeStationGunReqDto) {
        return chargeStationGunService.update(chargeStationGunReqDto);
    }

    @PostMapping("/online")
    public CommonResult<Boolean> online(@RequestBody ChargeStationGunReqDto chargeStationGunReqDto) {
        return chargeStationGunService.online(chargeStationGunReqDto);
    }

    @PostMapping("/bind")
    public CommonResult<Boolean> bind(@RequestBody ChargeStationGunReqDto chargeStationGunReqDto) {
        return chargeStationGunService.bind(chargeStationGunReqDto);
    }
    @PostMapping("/repair")
    public CommonResult<Boolean> repair(@RequestBody ChargeStationGunReqDto chargeStationGunReqDto) {
        return chargeStationGunService.repair(chargeStationGunReqDto);
    }

    @PostMapping("/list")
    public CommonResult<GunQueryPageRespDto> list(@RequestBody ChargeStationGunPageReqDto chargeStationGunPageReqDto) {
        return chargeStationGunService.list(chargeStationGunPageReqDto);
    }

    @GetMapping("/{id}")
    public CommonResult<ChargeStationGunRespDto> findById(@PathVariable("id") Integer id) {
        return chargeStationGunService.queryById(id);
    }
}
